{ This set of macros is for analyzing a particular set of stacks } var fore,foredef: integer; {global variables } bkgslope, bkgbase: real; bkgmin, bkgdelta: integer; bkg1000: integer; markSlice, dataSlice: integer; scaleMin,scaleMax: integer; procedure ClearInfoImage; begin ChoosePic(1); SetBackgroundColor(0); SetForegroundColor(255); SelectAll; Clear; KillRoi; end; procedure CheckForStack; begin if nSlices=0 then begin PutMessage('This window is not a stack'); exit; end; end; procedure DecodeSliceNumber; var bad: Boolean; h,t,u: integer; begin h := GetPixel(0,0) - 128; t := GetPixel(1,0) - 128; u := GetPixel(2,0) - 128; bad := true; if h >= 0 then if t >= 0 then if u >= 0 then if h < 10 then if t < 10 then if u < 10 then bad := false; if bad then begin PutMessage('Bad mark slice link h = ',h,' t = ',t,' u = ',u); exit; end; theSlice := h * 100 + t * 10 + u + 1; end; procedure DrawCutInfo(i: integer); begin if i = 0 then WriteLn('never cuts') else if i = 128 then WriteLn('not cut yet') else if i = 129 then WriteLn('cutting here') else if i = 130 then WriteLn('fully cut') else WriteLn('undefined code ',i); end; procedure DrawInfoInImage1; var theSlice: integer; mPic,mSliceNumber,mNSlices: integer; dPic,dSliceNumber,dNSlices: integer; d16Pic,d16SliceNumber,d16NSlices: integer; mtype,quality: integer; c5,c6,c7,c8,c9: integer; begin if foredef = 0 then foredef := 1; if fore = 0 then fore := foredef; RequiresVersion(11.44); ClearInfoImage; ChoosePic(MarkupPicNumber('data')); dPic := PicNumber; dSliceNumber := SliceNumber; dNSlices := nSlices; ChoosePic(MarkupPicNumber('data16')); if dSliceNumber <> SliceNumber then begin {PutMessage('Selecting data16 slice');} ChooseSlice(dSliceNumber); end; d16Pic := PicNumber; d16SliceNumber := SliceNumber; d16NSlices := nSlices; ChoosePic(MarkupPicNumber('mark')); mPic := PicNumber; mSliceNumber := SliceNumber; mNSlices := nSlices; mtype := getPixel(3,0); quality := getPixel(4,0); c5 := getPixel(5,0); c6 := getPixel(6,0); c7 := getPixel(7,0); c8 := getPixel(8,0); c9 := getPixel(9,0); DecodeSliceNumber; ChoosePic(1); MoveTo(20,20); WriteLn('Mark (',mPic:0,') ',mSliceNumber,'/',mNSlices); WriteLn('Data (',dPic:0,') ',dSliceNumber,'/',dNSlices); WriteLn('Data16 (',d16Pic:0,') ',d16SliceNumber,'/',d16NSlices); if theSlice <> dSliceNumber then begin SetForegroundColor(1); WriteLn('*** WARNING ***'); SetForegroundColor(255); WriteLn('DataPtr ',theSlice:0,' does not match'); SetForegroundColor(1); WriteLn('*** WARNING ***'); SetForegroundColor(255); end; Write('Marks slice type: '); if mtype = 128 then WriteLn('documentation') else if mtype = 129 then WriteLn('length') else if mtype = 130 then WriteLn('intensity') else if mtype = 131 then WriteLn('radius') else WriteLn('undefined code ',mtype); Write('Marks focus quality'); if quality = 128 then WriteLn('good') else if quality = 129 then WriteLn('fair') else if quality = 130 then WriteLn('poor') else if quality = 0 then WriteLn('default(fair)') else WriteLn('undefined code ',quality); WriteLn('Cuts ',c5,c6,c7,c8,c9); Write('red-green '); DrawCutInfo(c5); Write('green-blue '); DrawCutInfo(c6); Write('blue-yellow '); DrawCutInfo(c7); Write('yellow-cyan '); DrawCutInfo(c8); Write('cyan-magenta '); DrawCutInfo(c9); ChoosePic(MarkupPicNumber('mark')); SetForegroundColor(fore); ChoosePic(1); Markup('show',0); end; procedure FindClosestMarkSlice; var i, n, d, theSlice: integer; begin ChoosePic(MarkupPicNumber('data')); d := SliceNumber; ChoosePic(MarkupPicNumber('mark')); n := nSlices; i := SliceNumber; DecodeSliceNumber; while (theSlice <= d) and (i < n) do begin i := i + 1; ChooseSlice(i); DecodeSliceNumber; end; while (theSlice > d) and (i > 1) do begin i := i - 1; ChooseSlice(i); DecodeSliceNumber; end; SelectSlice(SliceNumber); DrawInfoInImage1; end; procedure SelectDataSlice; var theSlice: integer; begin ChoosePic(MarkupPicNumber('mark')); DecodeSliceNumber; ChoosePic(MarkupPicNumber('data16')); if theSlice > nSlices then begin PutMessage('Data16 slice ',theSlice,' does not exist.'); exit; end; ChooseSlice(theSlice); ChoosePic(MarkupPicNumber('data')); if theSlice > nSlices then begin PutMessage('Data slice ',theSlice,' does not exist.'); exit; end; SelectSlice(theSlice); dataSlice := theSlice; end; procedure findSliceType(mtype: integer); var i, first, t: integer; begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; SetBackgroundColor(0); SetForegroundColor(1); fore := foredef; ChoosePic(MarkupPicNumber('mark')); i := sliceNumber; first := i; repeat i := i + 1; if i > nSlices then i := 1; if i = first then begin PutMessage('No slice found of specified type'); SelectSlice(SliceNumber); DrawInfoInImage1; exit; end; ChooseSlice(i); t := GetPixel(3,0); if t < 128 then t := 0; if t > 131 then t := 0; until t = mtype; SelectSlice(SliceNumber); SelectDataSlice; Markup('calcbkg',0); Markup('calchist', 0); DrawInfoInImage1; Markup('show',0); end; macro 'DisposeAll'; var i: integer; begin i := GetNumber('Enter 0 to cancel dispose all',1); if i <> 0 then DisposeAll; end; macro '(-' begin end; procedure DecodeSliceCheckOrder; begin DecodeSliceNumber; if theSlice < lastSlice then begin SelectSlice(SliceNumber); DrawInfoInImage1; PutMessage('Mark slices out of order here, last data slice was ',lastSlice:0); exit; end; lastSlice := theSlice; end; procedure checkCutError(c,s: integer); begin if (s <> 0) and (s <> theSlice) then begin if c = 5 then PutMessage('Red Green also cuts at slice ',s) else if c = 6 then PutMessage('Green Blue also cuts at slice ',s) else if c = 7 then PutMessage('Blue Yellow also cuts at slice ',s) else if c = 8 then PutMessage('Yellow Cyan also cuts at slice ',s) else if c = 9 then PutMessage('Cyan Magenta also cuts at slice ',s) else PutMessage('checkCutError bug',c,s); SelectSlice(SliceNumber); DrawInfoInImage1; exit; end; end; procedure extendCuttingData; var saveSlice, i: integer; s5,s6,s7,s8,s9: integer; v5,v6,v7,v8,v9: integer; theSlice, lastSlice: integer; begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; saveSlice := sliceNumber; s5 := 0; s6 := 0; s7 := 0; s8 := 0; s9 := 0; lastSlice := 0; for i := 1 to nSlices do begin ChooseSlice(i); DecodeSliceCheckOrder; if GetPixel(5,0) = 129 then begin checkCutError(5,s5); s5 := theSlice; end; if GetPixel(6,0) = 129 then begin checkCutError(6,s6); s6 := theSlice; end; if GetPixel(7,0) = 129 then begin checkCutError(7,s7); s7 := theSlice; end; if GetPixel(8,0) = 129 then begin checkCutError(8,s8); s8 := theSlice; end; if GetPixel(9,0) = 129 then begin checkCutError(9,s9); s9 := theSlice; end; end; for i := 1 to nSlices do begin v5 := 0; v6 := 0; v7 := 0; v8 := 0; v9 := 0; ChooseSlice(i); DecodeSliceNumber; if s5 <> 0 then begin if s5 > theSlice then v5 := 128 else if s5 = theSlice then v5 := 129 else v5 := 130; end; if s6 <> 0 then begin if s6 > theSlice then v6 := 128 else if s6 = theSlice then v6 := 129 else v6 := 130; end; if s7 <> 0 then begin if s7 > theSlice then v7 := 128 else if s7 = theSlice then v7 := 129 else v7 := 130; end; if s8 <> 0 then begin if s8 > theSlice then v8 := 128 else if s8 = theSlice then v8 := 129 else v8 := 130; end; if s9 <> 0 then begin if s9 > theSlice then v9 := 128 else if s9 = theSlice then v9 := 129 else v9 := 130; end; PutPixel(5,0,v5); PutPixel(6,0,v6); PutPixel(7,0,v7); PutPixel(8,0,v8); PutPixel(9,0,v9); end; SelectSlice(saveSlice); DrawInfoInImage1; end; macro 'Extend cutting data'; begin extendCuttingData; end; procedure openDataMark; var w,h,i,n,d,d16: integer; begin RequiresVersion(11.44); if (nPics <> 0) then begin PutMessage('First save work and close all windows'); exit; end; SetNewSize(256,256); MakeNewWindow('Flags from the Marks Stack'); SetBackgroundColor(0); SetForegroundColor(255); Open(''); SetBackgroundColor(0); if nSlices=0 then begin PutMessage('This window is not a stack'); exit; end; GetPicSize(w,h); if (w div 4) * 4 <> w then begin PutMessage('Width (',w:1,') is not a multiple of four, widening.'); PutMessage('Write down the image name'); d := PicNumber; n := nSlices; SetNewSize(((w + 3) div 4) * 4,h); MakeNewStack('Widened 16 bit stack'); d16 := PicNumber; for i := 1 to n do begin ChoosePic(d); ChooseSlice(1); SelectAll; Copy; DeleteSlice; ChoosePic(d16); if i > nSlices then AddSlice; ChooseSlice(i); MakeRoi(0,0,w,h); Paste; end; ChoosePic(d); Dispose; ChoosePic(nPics); GetPicSize(w,h); end; Markup('data16', PicNumber); n := nSlices; d16 := PicNumber; SelectSlice(1); SetNewSize(w,h); MakeNewWindow('16 bit bkg (trash)'); Markup('bkg', PicNumber); SetNewSize(w div 2,h); MakeNewStack('New 8 bit marks stack'); PutPixel(0,0,128); PutPixel(1,0,128); PutPixel(2,0,128); PutPixel(3,0,128); Markup('mark', PicNumber); MakeNewStack('8 bit stack (trash)'); Markup('data', PicNumber); d := PicNumber; Markup('show', 0); scaleMin := GetNumber('Scale min',scaleMin); scaleMax := GetNumber('Scale max',scaleMax); Markup('scalemin', scaleMin); Markup('scalemax', scaleMax); for i := 1 to n do begin ChoosePic(d); if i > nSlices then AddSlice; ChooseSlice(i); ChoosePic(d16); ChooseSlice(i); Markup('scale16b',0); end; {Force complete update of data windows} SelectPic(d16); SelectSlice(2); SelectSlice(1); SelectPic(d); SelectSlice(2); SelectSlice(1); DrawInfoInImage1; SelectPic(1); extendCuttingData; end; procedure ApplyBkgParams; begin Markup('ridges',0); Markup('bkgcoef', bkg1000/1000); Markup('bkgmin', bkgmin); Markup('bkgdelta', bkgdelta); if bkgslope <> 0 then Markup('bkgcone', bkgslope) else Markup('bkgexponential',bkgbase); end; macro 'Open a 16 bit stack'; begin openDataMark; ApplyBkgParams; end; macro 'Rescale 16 bit to make new 8 bit'; var w,h,i,n,d,d16: integer; begin RequiresVersion(11.44); d := MarkupPicNumber('data'); d16 := MarkupPicNumber('data16'); scaleMin := GetNumber('Scale min',scaleMin); scaleMax := GetNumber('Scale max',scaleMax); Markup('scalemin', scaleMin); Markup('scalemax', scaleMax); ChoosePic(d16); n := nSlices; for i := 1 to n do begin ChoosePic(d); if i > nSlices then AddSlice; ChooseSlice(i); ChoosePic(d16); ChooseSlice(i); Markup('scale16b',0); end; SelectPic(d16); SelectSlice(2); SelectSlice(1); SelectPic(d); SelectSlice(2); SelectSlice(1); DrawInfoInImage1; SelectPic(1); end; macro 'Open an existing marks stack'; var w,h,w2,h2: integer; begin PutMessage('Find the marks stack'); Open(''); GetPicSize(w,h); SelectPic(MarkupPicNumber('mark')); GetPicSize(w2,h2); SelectPic(nPics); if nSlices = 0 then begin PutMessage('New mark image is not a stack'); exit; end; if w <> w2 then begin PutMessage('New mark width (',w2:0,') must match old width (',w,')'); exit; end; if h <> h2 then begin PutMessage('New mark height (',h2:0,') must match old height (',h,')'); exit; end; Markup('mark',nPics); DrawInfoInImage1; SelectPic(1); end; procedure findMarksSameData; var i: integer; begin end; procedure dupSliceError(s: integer); begin SelectSlice(SliceNumber); DrawInfoInImage1; PutMessage('Mark slice ',s,' is a duplicate (same data slice, same type)'); exit; end; procedure findDupMark; var saveSlice,theLenMark,theRadMark,theIntMark,i: integer; h,t,u: integer; theSlice, lastSlice: integer; begin ChoosePic(MarkupPicNumber('mark')); KillRoi; saveSlice := sliceNumber; i := 1; lastSlice := 0; while (i <= nSlices) do begin chooseSlice(i); DecodeSliceCheckOrder; h := GetPixel(0,0); t := GetPixel(1,0); u := GetPixel(2,0); theLenMark := 0; theRadMark := 0; theIntMark := 0; while (i <= nSlices) and (getPixel(0,0) = h) and (getPixel(1,0) = t) and (getPixel(2,0) = u) do begin if getPixel(3,0) = 129 then begin if theLenMark <> 0 then dupSliceError(theLenMark); theLenMark := sliceNumber; end else if getPixel(3,0) = 130 then begin if theIntMark <> 0 then dupSliceError(theIntMark); theIntMark := sliceNumber; end else if getPixel(3,0) = 131 then begin if theRadMark <> 0 then dupSliceError(theRadMark); theRadMark := sliceNumber; end else if getPixel(3,0) <> 128 then begin SelectSlice(SliceNumber); DrawInfoInImage1; PutMessage('Invalid slice type code'); exit; end; i := i + 1; if i <= nSlices then chooseSlice(i); end; end; SelectSlice(saveSlice); DrawInfoInImage1; end; macro 'Find duplicate mark slice'; begin findDupMark; end; macro 'Next Unclassified Slice' begin findSliceType(0); end; macro 'Next Documentation Slice' begin findSliceType(128); end; macro 'Next Length Slice' begin findSliceType(129); end; macro 'Next Intensity Slice' begin findSliceType(130); end; macro 'Next radius Slice' begin findSliceType(131); end; procedure addMarkThisData(mtype: integer); var i, n, d, theSlice: integer; h, t, u: integer; begin RequiresVersion(11.44); ChoosePic(MarkupPicNumber('data')); d := SliceNumber; ChoosePic(MarkupPicNumber('mark')); SetBackgroundColor(0); n := nSlices; i := SliceNumber; DecodeSliceNumber; while (theSlice <= d) and (i < n) do begin i := i + 1; ChooseSlice(i); DecodeSliceNumber; end; while (theSlice > d) and (i > 1) do begin i := i - 1; ChooseSlice(i); DecodeSliceNumber; end; if (theSlice > d) then begin SelectPic(picNumber); {added b/c copy failed when markup window was active} SelectSlice(sliceNumber); SelectAll; Copy; KillROI; AddSlice; Paste; KillROI; ChooseSlice(1); SelectAll; Clear; end else begin AddSlice; end; KillROI; SelectSlice(SliceNumber); d := d - 1; u := d; d := d div 10; u := u - d * 10 + 128; t := d; d := d div 10; t := t - d * 10 + 128; h := d; d := d div 10; h := h - d * 10 + 128; PutPixel(0,0,h); PutPixel(1,0,t); PutPixel(2,0,u); PutPixel(3,0,mtype); Markup('calcbkg',0); Markup('calchist', 0); DrawInfoInImage1; Markup('show',0); end; macro '[F5] Add Documentation mark for this Data'; begin addMarkThisData(128); end; macro '[F6] Add Length mark for this Data'; begin addMarkThisData(129); end; macro '[F7] Add Intensity mark for this Data'; begin addMarkThisData(130); end; macro '[F8] Add radius mark for this Data'; begin addMarkThisData(131); end; macro '[F9] Copy previous length mark to this mark'; var saveSlice, i: integer; width,height: integer; begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; saveSlice := sliceNumber; i := sliceNumber; while i > 1 do begin i := i - 1; selectSlice(i); if getPixel(3,0) = 129 then i := 1; end; GetPicSize(width,height); MakeRoi(0,1,width,height-1); copy; selectSlice(saveSlice); paste; KillRoi; end; Procedure copyLenRadToInt; var thisMark,thisData,theLenMark,theRadMark,theSlice,i: integer; h,t,u: integer; width,height: integer; begin RequiresVersion(11.44); SetBackgroundColor(0); SelectPic(MarkupPicNumber('mark')); {select so copy works} GetPicSize(width,height); thisMark := sliceNumber; if getPixel(3,0) <> 130 then begin PutMessage('This is not an intensity mark slice'); exit; end; DecodeSliceNumber; h := GetPixel(0,0); t := GetPixel(1,0); u := GetPixel(2,0); thisData := theSlice; theLenMark := 0; theRadMark := 0; i := sliceNumber; while (i > 0) and (getPixel(0,0) = h) and (getPixel(1,0) = t) and (getPixel(2,0) = u) do begin i := i - 1; if i > 0 then chooseSlice(i); end; i := i + 1; chooseSlice(i); while (i <= nSlices) and (getPixel(0,0) = h) and (getPixel(1,0) = t) and (getPixel(2,0) = u) do begin if getPixel(3,0) = 129 then theLenMark := sliceNumber else if getPixel(3,0) = 131 then theRadMark := sliceNumber; i := i + 1; if i <= nSlices then chooseSlice(i); end; if theLenMark <> 0 then begin chooseSlice(theLenMark); MakeRoi(0,1,width,height-1); copy; chooseSlice(thisMark); paste; end; if theRadMark <> 0 then begin SetForegroundColor(255); chooseSlice(theRadMark); MakeRoi(0,1,width,height-1); copy; chooseSlice(thisMark); paste; if theLenMark <> 0 then DoOr; end; selectSlice(thisMark); KillRoi; SetForegroundColor(fore); end; macro '[F10] Copy length OR radius mark to this intensity mark'; begin copyLenRadToInt; Markup('show',0); end; macro '[F3] Copy this mark image'; var width,height: integer; begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; GetPicSize(width,height); MakeRoi(0,1,width,height-1); copy; KillRoi; end; macro '[F4] Paste onto this mark image'; var width,height: integer; begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; GetPicSize(width,height); MakeRoi(0,1,width,height-1); paste; KillRoi; end; procedure ChooseDataSlice; var theSlice: integer; begin ChoosePic(MarkupPicNumber('mark')); DecodeSliceNumber; ChoosePic(MarkupPicNumber('data16')); if theSlice > nSlices then begin PutMessage('Data16 slice ',theSlice,' does not exist.'); exit; end; ChooseSlice(theSlice); ChoosePic(MarkupPicNumber('data')); if theSlice > nSlices then begin PutMessage('Data slice ',theSlice,' does not exist.'); exit; end; ChooseSlice(theSlice); dataSlice := theSlice; end; procedure SetBkgParams; begin if bkg1000 = 0 then bkg1000 := 1000; bkg1000 := GetNumber('BkgCoef*1000=',bkg1000); if bkgmin = 0 then bkgmin := 5; bkgmin := GetNumber('bkgmin',bkgmin); if bkgdelta = 0 then bkgdelta := 5; bkgdelta := GetNumber('bkgdelta',bkgdelta); if (bkgslope = 0) and (bkgbase = 0) then begin bkgslope := -10; bkgbase := 0; end; bkgslope := GetNumber('cone slope or 0 to use exp',bkgslope); if bkgslope = 0 then begin if bkgbase = 0 then bkgbase := 10; bkgbase := GetNumber('exponential base',bkgbase); end; end; macro '[n] Next Mark Slice' var i: integer; begin RequiresVersion(11.44); ClearInfoImage; ChoosePic(MarkupPicNumber('mark')); SetBackgroundColor(0); SetForegroundColor(1); fore := foredef; i := sliceNumber + 1; if i > nSlices then i := 1; SelectSlice(i); SelectDataSlice; Markup('calcbkg',0); Markup('calchist', 0); DrawInfoInImage1; Markup('show',0); end; macro '[b] Back to Previous Mark Slice' var i: integer; begin RequiresVersion(11.44); ClearInfoImage; ChoosePic(MarkupPicNumber('mark')); SetBackgroundColor(0); SetForegroundColor(1); fore := foredef; i := sliceNumber - 1; if i = 0 then i := nSlices; SelectSlice(i); SelectDataSlice; Markup('calcbkg',0); Markup('calchist', 0); DrawInfoInImage1; Markup('show',0); end; macro '[f] Next Data Slice' var i: integer; begin RequiresVersion(11.44); ClearInfoImage; ChoosePic(MarkupPicNumber('mark')); SetBackgroundColor(0); SetForegroundColor(1); fore := foredef; ChoosePic(MarkupPicNumber('data')); i := sliceNumber + 1; if i > nSlices then i := 1; SelectSlice(i); ChoosePic(MarkupPicNumber('data16')); SelectSlice(i); FindClosestMarkSlice; DrawInfoInImage1; end; macro '[d] Prevous Data Slice' var i: integer; begin RequiresVersion(11.44); ClearInfoImage; ChoosePic(MarkupPicNumber('mark')); SetBackgroundColor(0); SetForegroundColor(1); fore := foredef; ChoosePic(MarkupPicNumber('data')); i := sliceNumber - 1; if i = 0 then i := nSlices; SelectSlice(i); ChoosePic(MarkupPicNumber('data16')); SelectSlice(i); FindClosestMarkSlice; DrawInfoInImage1; end; macro '[g] Prev color' begin ChoosePic(MarkupPicNumber('mark')); SetBackgroundColor(0); fore := fore - 1; if fore < 1 then fore := 6; SetForegroundColor(fore); Markup('show',0); end; macro '[h] Next color' begin ChoosePic(MarkupPicNumber('mark')); SetBackgroundColor(0); fore := fore + 1; if fore > 6 then fore := 1; SetForegroundColor(fore); Markup('show',0); end; macro '[j] Next default color'; begin ChoosePic(MarkupPicNumber('mark')); SetBackgroundColor(0); foredef := foredef + 1; if foredef > 6 then foredef := 1; fore := foredef; SetForegroundColor(fore); Markup('show',0); end; macro 'Set background parameters' begin SetBkgParams; applyBkgParams; end; macro '(-' begin end; macro 'Show Markup' begin RequiresVersion(11.44); if (nPics = 0) or (PicNumber = 0) then PutMessage('Please select an image first') else begin Markup('show', 0); SetBkgParams; ApplyBkgParams; end; end; macro 'Audit this marks stack'; begin RequiresVersion(11.44); findDupMark; extendCuttingData; end; macro '[i] Get info regarding marks'; begin DrawInfoInImage1; end; macro 'This mark is documentation'; begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; putPixel(3,0,128); DrawInfoInImage1; end; macro 'This mark is for length'; begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; putPixel(3,0,129); DrawInfoInImage1; end; macro 'This mark is for intensity'; begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; putPixel(3,0,130); DrawInfoInImage1; end; macro 'This mark is for radius'; begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; putPixel(3,0,131); DrawInfoInImage1; end; macro '[q] Focus good'; begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; putPixel(4,0,128); DrawInfoInImage1; end; macro '[w] Focus fair'; begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; putPixel(4,0,129); DrawInfoInImage1; end; macro '[e] Focus poor'; begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; putPixel(4,0,130); DrawInfoInImage1; end; procedure cuttingHere(x: integer); begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; putPixel(x,0,129); DrawInfoInImage1; end; macro '[F11] Red-green cuts here'; begin cuttingHere(5); end; macro '[F12] Green-blue cuts here'; begin cuttingHere(6); end; macro '[F13] Blue-yellow cuts here'; begin cuttingHere(7); end; macro '[F14] Yellow-cyan cuts here'; begin cuttingHere(8); end; macro '[F15] Cyan-magenta cuts here'; begin cuttingHere(9); end; procedure notCuttingHere(x: integer); begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); KillRoi; putPixel(x,0,0); DrawInfoInImage1; end; macro 'Red-green does not cut here'; begin notCuttingHere(5); end; macro 'Green-blue does not cut here'; begin notCuttingHere(6); end; macro 'Blue-yellow does not cut here'; begin notCuttingHere(7); end; macro 'Yellow-cyan does not cut here'; begin notCuttingHere(8); end; macro 'Cyan-magenta does not cut here'; begin notCuttingHere(9); end; macro '[F1] Delete this mark slice' begin RequiresVersion(11.44); SelectPic(MarkupPicNumber('mark')); deleteSlice; Markup('calcbkg',0); Markup('calchist', 0); DrawInfoInImage1; Markup('show',0); end; macro '(-' begin end; macro '(Use front image' begin end; macro 'É as Markup data image' begin RequiresVersion(11.44); if (nPics = 0) or (PicNumber = 0) then PutMessage('Please select an image first') else Markup('data', PicNumber); end; macro 'É as Markup marks image' begin RequiresVersion(11.44); if (nPics = 0) or (PicNumber = 0) then PutMessage('Please select an image first') else Markup('mark', PicNumber); end; macro 'É as Markup bkg image' begin RequiresVersion(11.44); if (nPics = 0) or (PicNumber = 0) then PutMessage('Please select an image first') else Markup('bkg', PicNumber); end; macro 'É as Markup data16 image' begin RequiresVersion(11.44); if (nPics = 0) or (PicNumber = 0) then PutMessage('Please select an image first') else Markup('data16', PicNumber); end;